package com.piesat.quake.business.station.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;
import java.util.List;

import javax.validation.constraints.NotNull;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author ${author}
 * @since 2022-12-07
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper = false)
@TableName("region")
public class Region implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 区划code
     */
    @NotNull(message = "区划code不能为空")
    @TableId(value = "code", type = IdType.INPUT)
    private String code;

    /**
     * 区划名称
     */
    @NotNull(message = "区划名称不能为空")
    @TableField("name")
    private String name;

    @TableField("parent")
    private String parent;

    @TableField(exist = false)
    private List<StationInfo> stationInfoList;

    @TableField(exist = false)
    private List<Region> regions;

}
